package cn.omisheep.au.core;

import cn.omisheep.au.core.filter.AuRequestParamHandler;
import cn.omisheep.au.core.filter.AuUserResolver;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * 注册器
 *
 * @author zhou xin chen  😊
 * 联系方式 qq:1269670415  email:xinchenzhou666@gmail.com
 */
@Slf4j
public class AuHandlerRegister implements WebMvcConfigurer {

    @Autowired
    private  AuKey auKey;


    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(new AuUserResolver());
        resolvers.add(new AuRequestParamHandler(auKey));
    }
}
